{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Numpy和原生Python用于数组计算的性能对比\n",
    "\n",
    "需求：\n",
    "* 实现两个数组的加法\n",
    "* 数组A是1~N数字的平方\n",
    "* 数组B是1~N数字的立方\n",
    "\n",
    "对比使用Numpy和原生Python的性能对比"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 引入Numpy的包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "'1.16.2'"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 2
    }
   ],
   "source": [
    "np.__version__"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 使用Python原生语法实现对比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "def python_sum(n):\n",
    "    \"\"\" Python实现数组的加法\n",
    "    @param n：数组的长度\n",
    "    \"\"\"\n",
    "    a = [i**2 for i in range(n)]\n",
    "    b = [i**3 for i in range(n)]\n",
    "    c = []\n",
    "    for i in range(n):\n",
    "        c.append(a[i] + b[i])\n",
    "    return c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "[0, 2, 12, 36, 80, 150, 252, 392, 576, 810]"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 4
    }
   ],
   "source": [
    "# 测试一下\n",
    "python_sum(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 使用Numpy实现"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "def numpy_sum(n):\n",
    "    \"\"\" numpy实现数组的加法\n",
    "    @param n：数组的长度\n",
    "    \"\"\"\n",
    "    a = np.arange(n) ** 2\n",
    "    b = np.arange(n) ** 3\n",
    "    return a+b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "array([  0,   2,  12,  36,  80, 150, 252, 392, 576, 810], dtype=int32)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 6
    }
   ],
   "source": [
    "# 测试一下\n",
    "numpy_sum(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 性能对比：执行1000次"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "659 µs ± 9.08 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "%timeit python_sum(1000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "6.51 µs ± 158 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "%timeit numpy_sum(1000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 性能对比：执行10W次"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "71.4 ms ± 2.58 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "%timeit python_sum(10 * 10000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "599 µs ± 9.14 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "# 测试一段代码的运行时间\n",
    "%timeit numpy_sum(10 * 10000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 性能对比：执行1000W次"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "7.35 s ± 87 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "%timeit python_sum(1000 * 10000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "69.4 ms ± 2.3 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "%timeit numpy_sum(1000 * 10000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制性能对比图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "pytimes = [1.06*1000, 104*1000, 10.4*1000*1000]\n",
    "nptimes = [9.16, 424, 114*1000]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "df = pd.DataFrame({\n",
    "    \"pytimes\":pytimes,\n",
    "    \"nptimes\":nptimes,\n",
    "})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "      pytimes    nptimes\n0      1060.0       9.16\n1    104000.0     424.00\n2  10400000.0  114000.00",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>pytimes</th>\n      <th>nptimes</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1060.0</td>\n      <td>9.16</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>104000.0</td>\n      <td>424.00</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>10400000.0</td>\n      <td>114000.00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 16
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "<matplotlib.axes._subplots.AxesSubplot at 0x2d801a15b00>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 17
    },
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEACAYAAABI5zaHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAE3VJREFUeJzt3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zOzFdq2pwq8SNg4L6AaCsiVnR/O+qCDwN72u7IzD3AhyPi27VpqWdwzl2SCuTdMpJUIMNdkgpkuEtSgQx3SSqQ4S5JBfp/zSIBwdPRaGMAAAAASUVORK5CYII=\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "df.plot.bar()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}